using System;
using System.ServiceModel;
using EssentialWCF;

namespace Client
{
    [ServiceContract]
    public interface IStockService
    {
        [OperationContract]
        Container GetPrice(string ticker);
    }
    class Client
    {
        static void Main(string[] args)
        {

            ChannelFactory<IStockService> myChannelFactory =
            new ChannelFactory<IStockService>(
                        new BasicHttpBinding(),
                        new EndpointAddress("http://localhost:8000/EssentialWCF"));

            Console.WriteLine("Wait.....");
            Console.ReadKey();
            IStockService wcfClient = myChannelFactory.CreateChannel();

            Container p = wcfClient.GetPrice("msft");
            
            Console.WriteLine("Price:{0}",p);

        }
    }
}
